# @Time : 2021/8/5 11:22
# @Author : Li Kunlun
# @Description : 卷积神经网络（LeNet）


import utils as d2l
import mxnet as mx
from mxnet import autograd, gluon, init, nd
from mxnet.gluon import loss as gloss, nn
import time

# export CUDA_VISIBLE_DEVICES = 0, 1

# 查看电脑可用的GPU个数
# 输出：range(0, 1)
print(mx.test_utils.list_gpus())

# 测试GPU是否可用

# [[ 1.]]
# <NDArray 1x1 @gpu(0)>
print(mx.nd.ones((1, 1), mx.gpu(0)))

"""报错：
exec_ctx.dev_id < device_count_ (1 vs. 1) Invalid GPU Id: 1, Valid device id should be less than device_count: 1
"""
# print(mx.nd.ones((1, 1), mx.gpu(1)))
